<?php session_start(); 
if($_SESSION['ID']!= null){
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Stock</title>
<link href="css/----stock.css" type="text/css" rel="stylesheet">
<link href="css/reset.css" type="text/css" rel="stylesheet">
</head>

<body>
<div id="wrapper">
<?php
   $ID=$_SESSION['ID'];
   $UserNo=$_SESSION['UserNo']; 
?>
<!--
<?php

require('config.inc.php');
require('db.php');

db_connect();
db_select();

$sql = '';
$sql .= 'SELECT * FROM project WHERE UserNo=\''.$UserNo.'\' ';

$result = mysql_query($sql) or die('Invalid query: ' . mysql_error());

?>
-->

</p>
<p class="style2">&nbsp;</p>
<p align="left"><span class="style2">你的軌跡專案列表:</span></p>

<table width="60%" border="1" align="left" class="style2">
  <tr>
    <td>日期</td>
    <td>專案名稱</td>
    <td>編輯</td>
    <td>刪除</td>
  </tr>
<?php

//$count = 0;
while ($row = mysql_fetch_assoc($result)) {
	echo "<tr>\n";
			echo "<td>" . $row['fname'] . "</td>\n";
			echo "<td>" . $row['pname'] . "</td>\n";
			echo "<td><a target='blank' href = 'proj_edit.html?No=".$row['fname'] ."'>編輯</a></td>\n";
			echo "<td><a href = 'proj_del.php?No=".$row['ProjNo'] ."'>刪除</a></td>\n";
	echo "</tr>\n";
}
mysql_free_result($result);

?>

</table>
<?php
   db_close();
}else{
   header("Location:"."login.html");
}
?>
</div>
</body>
</html>
